OB.Emes_ActionButton = OB.Emes_ActionButton || {};

// 领料单打印
OB.Emes_ActionButton.PrintPickLists = function(params, win) {
	
	var grid = win.activeView.viewGrid;
	var record = grid.getSelectedRecord();
	
	if(record.generateStatus == 'EXECUTED'){ // 点击计划打开
		
		isc.EMESR_SmartBI_Receipt_Print.create({
			title: "领料单打印",
			idName: "manuOrderId",
			dataId: record.id,
			reportId: "I40282c81015cc9e9c9e9b6d0015cca04862901d5"
		}).show();
		
	}else{ 
		isc.showMessage("请选择已经生成领料单的记录！");
	}
	
};


// 领料单打印
OB.Emes_ActionButton.PrintJobOrders = function(params, win) {
	
	var grid = win.activeView.viewGrid;
	var records = grid.getSelectedRecords();
	
	
	if(records.length){
		
	var ids = [];
	for(var i = 0;i<records.length;i++){
		ids.push(records[i].id);
	}
	ids.join(',');
		isc.EMESR_SmartBI_Receipt_Print.create({
			title: "作业订单打印",
			idName: "jobOrderId",
			dataId: ids,
			reportId: "I40282c81015cce86ce86202f015cce9a3d9c0025"
		}).show();
		
	}else{
		isc.showMessage("请选择作业订单记录！");
	}
};

//大包装条码打印
OB.Emes_ActionButton.PrintBigPackageLabel = function(code) {
	
	if(code == ""){
		
		
	}else{
		isc.EMESR_SmartBI_Receipt_Print.create({
			title: "大包装条码打印",
			idName: "bigPackageCode",
			dataId: code,
			reportId: "I4028e47e0160062906297c3501600a777082006f"
		}).show();
	}
};
